05. Redux and React Native
Redux and React Native
Redux in React Native
Adding Redux
Recall that Redux is a predictable state container for JavaScript applications. It is agnostic to any particular view library or framework, so not only can we use it with React, but we can integrate it into React Native applications, as well!
With its lean size and minimal dependencies, Redux is a great tool for React Native projects. And best of all: since React Native is still fundamentally just JavaScript, Redux can be added into projects the same way that we're used to. Let's check it out -- first, with building out actions!
Actions
Reducers
💡 Forgot Redux?💡
If you need a refresher on the principles of Redux, feel free to check out the previous course again, React & Redux! Since Redux is agnostic to any particular view library or framework, the same principles of Redux will apply to applications built with React Native as well.
CreateStore
Connect-AddEntry
Task Description:
We've just incorporated redux to help manage our global state. Let's make sure we're on the same page!
Task Feedback:
Fantastic!
Summary
Remember that React Native is fundamentally still just JavaScript. As such, adding Redux to help manage application state will involve the very same principles and processes as adding Redux to a web application.